A Domain Specific Language for Composable Memory Transactions in Java
نویسندگان
چکیده
In this paper we present CMTJava, a domain specific language for composable memory transactions [7] in Java. CMTJava provides the abstraction of transactional objects. Transactional objects have their fields accessed only by special get and set methods that are automatically generated by the compiler. These methods return transactional actions as a result. A transactional action is an action that, when executed, will produce the desired effect. Transactional actions can only be executed by the atomic method. Transactional actions are first class values in Java and they are composable: transactions can be combined to generate new transactions. The Java type system guarantees that the fields of transactional objects will never be accessed outside a transaction. CMTJava supports the retry and orElse constructs from STM Haskell. To validate our design we implemented a simple transactional system following the description of the original Haskell system. CMTJava is implemented as a state passing monad using BBGA closures, a Java extension that supports closures in Java.
منابع مشابه
A Composable Mixed Mode Concurrency Control Semantics for Transactional Programs
Most software transactional memories employ optimistic concurrency control. A pessimistic semantics, however, is not without its benefits: its programming model is often much simpler to reason about and supports the execution of irreversible operations. We present a programming model that supports both optimistic and pessimistic concurrency control semantics. Our pessimistic transactions, guara...
متن کاملAttribute Grammar-Based Language Extensions for Java
This paper describes the Java Language Extender framework, a tool that allows one to create new domain-adapted languages by importing domain-specific language extensions into an extensible implementation of Java 1.4. Language extensions may define the syntax, semantic analysis, and optimizations of new language constructs. Java and the language extensions are specified as higher-order attribute...
متن کاملThe Development of Reading and Operation Span Tasks in Persian as Measures of Working Memory Capacity for Iranian EFL Learners
This paper presented two complex span tasks in Persian as measures of working memory capacity (WMC). Firstly, the construct of working memory (WM) and possible WM measures that could assess this construct efficiently were critically reviewed. Accordingly, as measures of domain-general components of WM, a reading span task and an operation span task which were documented to assess this construct...
متن کاملComposable Transactional Objects: A Position Paper
Memory transactions provide programmers with a convenient abstraction for concurrent programs: a keyword (such as atomic) designating a region of code that appears, from the perspective of concurrent threads, to execute atomically. Unfortunately, existing implementations in the form of software transactional memory (STM) are often ineffective due to their monolithic nature: every single read or...
متن کاملReasoning about Card Tears and Transactions in Java Card
The Java dialect Java Card for programming smartcards contains some features which do not exist in Java. Java Card distinguishes persistent and transient data (data stored in EEPROM and RAM, respectively). Because power to a smartcard can suddenly be interrupted by a so-called card tear, by someone removing the smartcard from the reader, Java Card provides a notion of transaction to ensure that...
متن کامل